package cn.com.cetccst.hostsdk;

import android.content.Context;

import androidx.annotation.NonNull;

import cn.com.cetccst.hostsdk.internal.ISSAPIEventLocalHandler;
import cn.com.cetccst.hostsdk.internal.SSApiImplLocal;
import cn.com.cetccst.logmanager.LogManager;

import org.slf4j.Logger;

public class HostSdkManager {

    public static Logger logger;

    public static void initialize(Context context, @NonNull ISSAPIEventLocalHandler handler) {
        if (logger == null) {
            logger = new LogManager.Builder(context, "HostSdk").setRollingModel(LogManager.TriggeringModel.MODEL_TIME_BASED).build();
        }
        SSApiImplLocal.initialize(context);
        SSApiImplLocal.getInstance(context).setSSAPIEventLocalHandler(handler);
    }

    /**
     * 可以指定接入SDK的日志输入的目录
     *
     * @param logger
     */
    public static void setLogger(Logger logger) {
        HostSdkManager.logger = logger;
    }

}
